<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title></title>
	<style type="text/css">
		#cont{
			height: 100%;
			width: 100%;
			background: #CC99CD;
			overflow-y: auto;
			
		}
		#scoll{
			height: 2000px;
			width: 50%;
			background: #0000FF;
		}
	</style>
</head>
<body>
	<div id="cont">
		<div id="scoll">
			111
		</div>
	</div>
	
	<script type="text/javascript">
		window.onscroll=function($event){
			var scr = document.documentElement
			scrtop = scr.scrollTop
			console.log(scrtop);
		}
	</script>
</body>
</html>